package com.lpx.blog.admin.convert;

import com.lpx.blog.admin.entity.User;
import com.lpx.blog.dto.UserRegistryDTO;
import com.lpx.blog.interfaces.IMapping;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;

/**
 * @Author: ColorSheep
 * @Description: TODO
 * @Date: 2024/11/21 06:52
 * @Version: 1.0
 */
@Mapper(
		componentModel = "spring",
		unmappedSourcePolicy = ReportingPolicy.IGNORE,
		unmappedTargetPolicy = ReportingPolicy.IGNORE
)
public interface UserRegistryDTOToUserConverter extends IMapping<UserRegistryDTO, User> {

	@Mapping(target = "password", source = "registerPwd")
	@Mapping(target = "nickName", source = "registerNickName")
	@Mapping(target = "email", source = "registerEmail")
	@Override
	User sourceToTarget(UserRegistryDTO var1);


	@Mapping(target = "registerPwd", source = "password")
	@Mapping(target = "registerNickName", source = "nickName")
	@Mapping(target = "registerEmail", source = "email")
	@Override
	UserRegistryDTO targetToSource(User var1);

}
